package com.zju.DoctorGo.handler;

import com.zju.DoctorGo.entity.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class GlobalExceprtionHandler {

    @ExceptionHandler
    public Result handleException(Exception e){
        log.info("异常信息：{}",e.getMessage());
        return Result.error(e.getMessage());
    }
}
